import {request} from "./request";

export function getEmpPageInfo({pageNum,pageSize,
								   empName,
								   workId,
								   positionId,
								   deptId,
								   companyName}){
	return request({
		url: '/per/emp/page-info',
		method: 'get',
		params:{
			empName,
			workId,
			positionId,
			deptId,
			companyName,
			pageNum,
			pageSize
		}
	})
}

export function getDeptbyEmp(){
	return request({
		url:'/sys/position/dept-manage',
		method:'get'
	})
}

export function getEmpsByDeptId(deptId){
	return request({
		url: '/per/emp/by-dept',
		method: 'get',
		params: {
			 deptId
		}
	})
}


//1、重置用户密码
export function replacementEmpPwd({empId}){
	return request({
		url: '/per/emp/replacementPwd',
		method: 'put',
		data: {
			id:empId,
			password: '12345'
		}
	})
}

//2、修改用户密码
export function updateUserPwd({oldPwd,newPwd}){
	return request({
		url: '/per/emp/updatePwd',
		method: 'put',
		params:{
			oldPwd,
			newPwd
		}
	})
}

// 查询 排班人员
export function getWorkSchedule(deptId){
	return request({
		url:'/per/emp/byd/'+deptId,
		method:'get',
	})
}